package cn.iocoder.mall.order.biz.dao;

import cn.iocoder.mall.order.biz.dataobject.OrderCredential;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;


@Mapper
public interface OrderCredentialMapper extends BaseMapper<OrderCredential> {
    @Select("select  * from  order_credential  where order_id = #{id} limit 1 ")
    OrderCredential getOneByOrderId(@Param("id") Long orderId);

    @Select("select  * from  order_credential  where seller_id = #{userId} and is_consume = 1" +
            "        and consume_time >= #{startTime}" +
            "        and consume_time <= #{endTime} ")
    List<OrderCredential> getOrderCredentialListBuSellerId(@Param("userId") String userId,@Param("startTime")String startTime,@Param("endTime")String endTime);


}
